// 数组乱序方案
// 打乱题干和选项
export const shuffle = (arr: any[]) => {
  const arrCope = [...arr];
  const res = [];
  while (arrCope.length > 0) {
    const index = Math.floor(Math.random() * arrCope.length);
    const item = arrCope[index];
    if (item.results && item.results.length > 0) {
      item.results = shuffle(item.results);
    }
    res.push(item);
    arrCope.splice(index, 1);
  }
  return res;
};
